package com.shujunjun.project.strategy.more;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @author wsh
 * @since 2024/3/17 11:18
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class More1ServiceImpl implements More {

    final MoreStrategy moreStrategy;

    @Override
    public String method1(String param) {
        log.info("调用了方法1：{}", param);
        return "方法1被调用了" + param;
    }

    @Override
    public void afterPropertiesSet() {
        // 注册当前bean
        moreStrategy.register("more1", this);
    }
}
